package com.jsmy.marketing.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jsmy.marketing.R;
import com.jsmy.marketing.bean.ResourceBean;
import com.jsmy.marketing.utils.NetWork;

/**
 * Created with Android Studio.
 * User: wei_cd.
 * Date: 2018/4/18.
 * Time: 11:21.
 * To change for file | settings | file and code templates.
 */

public class ResourceMeAdapter extends BaseQuickAdapter<ResourceBean.DataBean.ListBean, BaseViewHolder> {

    public ResourceMeAdapter() {
        super(R.layout.fragment_home_item_z);
    }

    @Override
    protected void convert(BaseViewHolder helper, ResourceBean.DataBean.ListBean item) {
        helper.setText(R.id.tv_title, item.getTitle())
                .setText(R.id.tv_tip, item.getNote())
                .addOnClickListener(R.id.img_tip)
                .addOnClickListener(R.id.linear_bar);
        NetWork.setImageGlide(helper.getView(R.id.tv_title).getContext(),item.getIcon(), (ImageView) helper.getView(R.id.img));
    }
}
